// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue';
import App from './App';
import router from './router';
import store from './store';
import ElementUI from 'element-ui';
import NProgress from 'nprogress';
import 'element-ui/lib/theme-chalk/index.css';
import './icons/iconfont.css';
import './css/public.css';
import Public from './until/public';
import { MessageBox } from 'element-ui';

Vue.config.productionTip = false;
Vue.config.devtools = process.env.NODE_ENV !== 'production';
NProgress.configure({ showSpinner: false });
Vue.use(ElementUI);

if (Public.BrowserType()) {
	new Vue({
		el: '#app',
		router,
		store,
		template: '<App/>',
		components: {
			App
		}
	});
	let Url = window.location.href;
	let flag = Url.indexOf('errorBow') >= 0;
	if (flag) {
		router.replace({
			path: '/home/'
		});
	}
} else {
	new Vue({
		el: '#app',
		router,
		store,
		template: '<App/>',
		components: {
			App
		}
	});
	MessageBox.confirm('您使用的IE浏览器版本太低，请更换浏览器访问!', '消息提示', {
		confirmButtonText: '确定',
		showCancelButton: false,
		type: 'error'
	}).then(() => {

	}).catch(() => {

	});
	router.replace({
		path: '/errorBow'
	});
}
// new Vue({
// 	router,
// 	store,
// 	template: '<App/>',
// 	components: {
// 		App
// 	}
// }).$mount('#app');